package c.e.a.b.g;

import java.util.concurrent.CancellationException;
import java.util.concurrent.Executor;

public final class w implements Runnable {
    public final /* synthetic */ g a;
    public final /* synthetic */ v b;

    public w(v vVar, g gVar) {
        this.b = vVar;
        this.a = gVar;
    }

    public final void run() {
        Exception exception;
        try {
            g a = this.b.b.a(this.a.h());
            if (a == null) {
                v vVar = this.b;
                vVar.c.m(new NullPointerException("Continuation returned null"));
                return;
            }
            Executor executor = i.b;
            a.c(executor, this.b);
            a.b(executor, this.b);
            a.a(executor, this.b);
        } catch (e e) {
            if (e.getCause() instanceof Exception) {
                exception = (Exception) e.getCause();
                this.b.c.m(exception);
                return;
            }
            this.b.c.m(e);
        } catch (CancellationException unused) {
            this.b.c.o();
        } catch (Exception exception2) {
            this.b.c.m(exception2);
        }
    }
}
